<?php

/*
 * Edit by shengxin
 * Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
 */
namespace api\mall\task;
use api\mall\model\OnlineModel;
/**
 * Description of OnlineTask
 *
 * @author PC
 */
class OnlineTask extends BaseTask{
    
    public function check_comp($task) {
        $model = new OnlineModel();
        $userid = $task['user_id'];
        $date = $task['date'];
        $online = $model->where('user_id',$userid)->where('date',$date)->find();
        if($online && $online->total_time >= $task['task_req']*60){
            return true;
        }
        return false;
    }
}
